<?php

/**
 * Description of BaseAction
 *
 * @author Petrica Martinescu
 */
class BaseActions extends sfActions {
 
  public function renderJSON() {
    $variables = $this->getVarHolder()->getAll();
    
    if (sfConfig::get('sf_environment') != 'dev' || $this->getRequest()->isXmlHttpRequest()) {
      $this->getResponse()->setHttpHeader('Content-type', 'application/json');
    }
    
    return $this->renderText(json_encode($variables));
  }
  
}

?>
